<template>
    <div class="centerBox">
        <div class="main-tab clearfix">
        	<router-link class="supplier-link" to="/forecast" v-if="role_id!=2&&role_id!=3" :class="{'cur':ad=='forecast'}" @click.native="changeClass('forecast')">需求预测</router-link>
            <router-link class="supplier-link" to="/proposal" :class="{'cur':ad=='proposal'}" @click.native="changeClass('proposal')">建议订单与到货</router-link>
            <router-link class="supplier-link" to="/basis" :class="{'cur':ad=='basis'}" @click.native="changeClass('basis')">决策依据</router-link>
        </div>
        <router-view></router-view>
    </div>
</template>
    
<script>
    export default{
        data(){
            return{
                ad:window.location.href.split("/")[window.location.href.split("/").length-1],
                role_id:0
            }
        },
        methods:{
            changeClass(name){
                this.ad = name
            },
            getRole_id:function(){
            	this.role_id = localStorage.getItem("role_id");	
            	if(this.role_id==3){
            		this.ad ="proposal";
            	}
            }
        },
        mounted(){
			//this.changeClass()
			this.getRole_id();
			
        }
    }
</script>

<style>
    @import "../common/css/supplier.css";
</style>